<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style type="text/css">
        [v-cloak] {
            display: none
        }
    </style>
</head>

<body>
    <div id="app">
        <div v-cloak>{{msg}}</div>
        <div v-text='msg'></div>
        <div v-html='msg1'></div>
        <div v-pre>{{msg}}</div>
        <div>{{num}}</div>
        <div>
            <button v-on:click='num++'>点击</button>
            <button @click='handle'>点击1</button>
            <button @click='handle(123,234,$event)'>点击2</button>
        </div>
    </div>
    <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript">
        var m = new Vue({
            el: '#app', //填充在哪个选择器中,元素挂载位置，可以是css选择器，可以是dom元素
            data: { //提供数据，模型数据，值是一个对象
                msg: 'hello vue',
                msg1: '<h1>html</h1>',
                num: 0
            },
            methods: {
                handle: function(a, b) {
                    console.log(a, b);
                    console.log(event.target.tagName);
                    // 这里的this是Vue的实例对象
                    this.num++
                }
            }
        })
    </script>

</body>

</html>